package demo.preference.com.bluetoothdemo;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

/**
 * Created by My on 2017/7/14.
 */

public class DialogUtils {

    public  Dialog createLucencyLoadingDialog(Context context) {

        LayoutInflater inflater = LayoutInflater.from(context);
        View v = inflater.inflate(R.layout.lucency_dialog, null);// 得到加载view
        Dialog dialog = new Dialog(context, R.style.dialog);
        dialog.setCanceledOnTouchOutside(false);
        dialog.setCancelable(true);// 不可以用“返回键”取消
        dialog.setContentView(v, new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.MATCH_PARENT,
                LinearLayout.LayoutParams.MATCH_PARENT));// 设置布局
        dialog.show();
        return dialog;
    }
}
